package thread;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

public class ThreadDemo28 {
    public static void main(String[] args) throws InterruptedException {
       BlockingQueue<String> queue = new ArrayBlockingQueue<>(100);
        queue.put("aaa");//带有阻塞功能,offer不带阻塞
        String elem =  queue.take();

        System.out.println("elem="+elem);
        elem =  queue.take();
        System.out.println("elem="+elem);

    }
}
